<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/longin.css">
</head>

<body>
    <form>
        <p>
            <label>用户名:</label>
            <input type="text" placeholder="请设置用户名" id="username"/>
        </p>
        <p>
            <label>密码:</label>
            <input type="password" placeholder="请设置密码" id="password"/>
            <span></span>
        </p>
        <p>
            <label>验证码:</label>
            <input type="text" placeholder="请输入验证码" id="captcha"/>
            <button id="cpa">获取验证码</button>
            <span></span>
        </p>
        <p>
            <button id="btn">登录</button>
        </p>
        
    </form>
    <script src="../js/cookie.js"></script>
    <script src="../js/ajax.js"></script>
    <script src="../js/login.js"></script>
    <!-- <script>
        var user = document.querySelector('#username');
        var tel = document.querySelector('#tel');
        var pwd = document.querySelector('#password');
        var yzm = document.querySelector('#yzm');
        var btn = document.querySelector('#btn');
        var btn1 = document.querySelector('#btn1');


        //用户名：
        var username1 = /(^\u4e00-\u9fa5]{2,7}|[a-z]{1,14}$)/i;
        // var u = 'a';
        // console.log(user1.test(u));
        // console.log(reg.test(str));

        // 手机号：
        var tel1 = /^1[3-9]\d{9}$/;
        // console.log(reg.test(str));

        // 密码
        var password1 = /^[0-9a-zA-Z\,\.]{4,16}$/i;

        //验证码
        var yzm1 = /\d{6}/;

        btn.onclick = function () {
            var number = parseInt(Math.random() * (1000000 - 100000 + 1) + 100000);
            btn.innerHTML = number;
        }
        btn1.onclick = function () {
            if (!username1.test(username.value)) {
                alert('请输入正确的用户名')
            } else if (!tel1.test(tel.value)) {
                alert('请输入正确的手机号')
            } else if (!password1.test(pwd.value)) {
                alert('请输入正确密码')
            } else if (!(yzm.value == btn.innerHTML)) {
                alert('请请输入正确的验证码')
            } else {
                alert('注册成功')
            }

        }
    </script> -->
</body>

</html>